<?php
/**
 * Created by PhpStorm.
 * User: sunshine
 * Date: 2016/8/30
 * Time: 20:01
 */
require_once ('Admin/View/template/inc_admin.php');
?>

<div class="col-md-10  col-xs-12 col-sm-10 col-sm-offset-1 col-md-offset-1 col-xs-offset-1"  style="position: relative;top: 50px;"  >
    <h2 style="color: #03c2f9; margin-bottom: 0px;padding-bottom: 0px;"><p class="bg-white" style="margin-bottom: 10px;margin-top: 10px" >修改学生个人信息</p></h2>
    <h4><p class="bg-info" style="margin-top:0px ;padding:10px" ><a href="admin.php" style="color: white">首页&nbsp;</a>/&nbsp;修改学生个人信息</p></h4>
</div>
<div style="margin-top: 180px;margin-left: 250px;font-size: 20px;font-family: 微软雅黑"><p>修改学生个人信息</p></div>

  <?php 
$row=$data['student'];
$sname=$row['sname'];
$gender=$row['gender'];
$birthdate=$row['birthdate'];
$hobby=$row['hobby'];
$degree=$row['degree'];
$intro=$row['intro'];
$pic='upload/'.$row['pic'];
//将查询结果显示在表单中 
?>

        <div class="container-fluid col-sm-offset-1 col-md-10">
           <form  method=post action="admin.php?c=student&m=update" style="margin-top: 50px" enctype="multipart/form-data" class="form-horizontal" >
            <table class="table table-hover" style="width: 600px;margin-left: 20%;margin-top:50px; color: #0a0a0a;font-size: 20px;font-family: 微软雅黑">
              <caption>
                <h2 align="center"> <font color="gray">修改学生信息</font>
                </h2>
              </caption>
             

              <tr>
                <td>姓名：</td>
                <td>
                  <input type="text" name="sname" size=30 value=<?php echo $sname;?>></td>
              </tr>
              <tr style="padding-left: 50px;background-color: #eee;">
                <td>性别：</td>
                <td>
                  <input type="radio" name="gender" value="0"<?php if(!$gender) echo 'checked';?>
                  >男
                  <input type="radio" name="gender" value="1"<?php if($gender) echo 'checked';?>>女</td>
              </tr>
              <tr>
                <td>生日：</td>
                <td>
                  <input type="date" name="birthdate" size=30 value=<?php echo $birthdate;?>></td>
              </tr>
              <tr style="padding-left: 50px;background-color: #eee;">
                <td>爱好：</td>
                <td>
                  <input type="checkbox" name="hobby[]" value="旅游"<?php if(strstr($hobby,'旅游')) echo 'checked';?>
                  >旅游
                  <input type="checkbox" name="hobby[]" value="登山"<?php if(strstr($hobby,'登山')) echo 'checked';?>
                  >登山
                  <input type="checkbox" name="hobby[]" value="健身"<?php if(strstr($hobby,'健身')) echo 'checked';?>
                  >健身
                  <input type="checkbox" name="hobby[]" value="上网"<?php if(strstr($hobby,'上网')) echo 'checked';?>
                  >上网
                  <input type="checkbox" name="hobby[]" value="游泳"<?php if(strstr($hobby,'游泳')) echo 'checked';?>>游泳</td>
              </tr>
              <tr>
                <td width=150>学历</td>
                <td>
                  <select name="degree">
                    <option value="0">---请选择---</option>
                    <option value="1"<?php if($degree=='1') echo 'selected'; ?>>高中</option>
                    <option value="2"<?php if($degree=='2') echo 'selected'; ?>>大学</option>
                    <option value="3"<?php if($degree=='3') echo 'selected'; ?>>研究生</option>
                    <option value="4"<?php if($degree=='4') echo 'selected'; ?>>博士生</option>
                  </select>
                </td>
              </tr>
              <tr style="padding-left: 50px;background-color: #eee;">
                <td width=150>自我介绍：</td>
                <td>
                  <textarea name="intro" cols="40" rows="5">
                    <?php echo $intro;?></textarea>
                </td>
              </tr>
              <tr>
                <td width=150>头像</td>
                <td>
                  <img src='<?php echo $pic;?>
                  ' width=120 height=130 class="img-rounded">
                  <input type="file" name="pic"></td>
              </tr>
              <tr style="padding-left: 50px;background-color: #eee;">
                <td width=150>操作</td>
                <td>
                  <input type="submit" value="更新" class="btn btn-info">
                  <input type="reset" value="重置" class="btn btn-info"></td>
              </tr>
            </table>
                        </form>
          </div>
       

  </div>